package edu.suda.cxtz;

import com.github.dozermapper.core.Mapper;
import edu.suda.cxtz.modules.security.service.dto.AuthUserDto;
import edu.suda.cxtz.service.UserService;
import edu.suda.cxtz.utils.SpringContextHolder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.ApplicationPidFileWriter;
import org.springframework.context.annotation.Bean;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@RestController
public class RunApplication {

    public static void main(String[] args) {
        SpringApplication springApplication = new SpringApplication(RunApplication.class);
        springApplication.addListeners(new ApplicationPidFileWriter());
        springApplication.run(args);
    }

    @Bean
    public SpringContextHolder springContextHolder() {
        return new SpringContextHolder();
    }

    @GetMapping("/index")
    public String index() {
        return "Backend service started successfully";
    }
}
